package com.Maykk.objSerialization;


import java.io.Serializable;

/**
 * @ClassName: Student
 * @Description: TODO 学生类
 * @Author: MaykkStar@163.com
 */
public class Student implements Serializable {
    private String name;
    private String sex;
    private int age;
    // private transient int age; // 如果不想被序列化进文件 加 transient
    private float score;
    // private static final long serialVersionUID = -1776613833184934861L;

    public void method() {
        System.out.println("我是一个成员方法");
    }

    public Student() {
    }


    public Student(String name, String sex, int age, float score) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public float getScore() {
        return score;
    }

    public void setScore(float score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }

}
